<div class="ui-g-12 p-20">
  <p-panel headerClass="bg-none" [showScroll]="true" marginHeight='72'>
    <p-header>
      <div class="text-right p-6-0">
        <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8">巡检规则设置</span>
        <div *ngIf="!isEdit">
          <button pButton type="button" (click)="edit()" label="编辑" class="btn btn-secondary"></button>
        </div>
        <div *ngIf="isEdit">
          <button pButton type="button" (click)="save()" label="保存" class="btn btn-secondary"></button>
          <button pButton type="button" (click)="cancel()" label="取消" class="btn btn-secondary"></button>
        </div>
      </div>
    </p-header>
    <div class="body-height">
      <div class="table-row">
        <div class="table-cell width-125 opacity06 text-right p-l-25">
          平均巡检天数：
        </div>
        <div class="table-cell  text-left">
          <div *ngIf="isEdit" class="icon-text inline-block" data-text="天"  style="margin-right:25px;">
            <p-spinner name="avgInspectionDays" size="30" maxlength="3" styleClass="p-spinner width-220" [(ngModel)]="inspectionForm.avgInspectionDays" placeholder="请输入平均巡检天数"
                       (onFocus)="inspectionDaysError =''" (onBlur)="inspectionDaysError = !inspectionForm.avgInspectionDays ? '请输入平均巡检天数' : ''" [step]="1" [min]="1" [max]="999"></p-spinner>
          </div>
          <div class="inline-block p-l-25 " *ngIf="!isEdit" style="padding:10px 0;">
            {{inspectionForm.avgInspectionDays}}
          </div>
          <div class="inline-block"  style="padding:10px 0;">
              注：平均几天一次巡检
              <p-message *ngIf="inspectionDaysError" severity="error" [text]="inspectionDaysError"></p-message>
          </div>
        </div>
      </div>
      <div class="table-row">
        <div class="table-cell width-125 opacity06 text-right p-l-25">
          是否考虑验收：
        </div>
        <div class="table-cell  text-left">
          <div *ngIf="isEdit" class="inline-block" style="margin-right:25px;" >
              <p-dropdown  required name="isConsiderCheck" [options]="isConsiderChecks" placeholder="请选择是否考虑验收" [style]="{width: '220px'}"
              [(ngModel)]="selectedisConsiderCheck" optionLabel="name" dataKey="code" appendTo="body" (focus)="selectedisConsiderCheckError = ''"></p-dropdown>
          </div>
          <div class="inline-block p-l-25"  *ngIf="!isEdit"  style="padding:9px 0;">
            {{inspectionForm.isThinkCheck == null ? '' : (inspectionForm.isThinkCheck ? '是' : '否')}}
          </div>
          <div class="inline-block" style="padding:9px 0;">
              注：选择是，表示到现场验收即为一次巡检
              <p-message *ngIf="selectedisConsiderCheckError" severity="error" [text]="selectedisConsiderCheckError"></p-message>
          </div>
        </div>
      </div>
    </div>
  </p-panel>

</div>
